<?php ob_start() ?>

<div class="jumbotron">
    <div class="container">
        <div class="text-center" style="margin-bottom: 20px;">
            <h1><i class="fa fa-gift"></i> <?php echo LABEL_MENUREGALOS ?></h1>
        </div>
        <div class="row">
            <?php foreach ($params_regalo as $param_regalo) { ?>
                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                    <div class="panel panel-body no-border border-left-green animated fadeInDown">
                        <div class="row row-body">
                            <div align="center">
                                <a href="regalo/<?php echo $param_regalo['id'] ?>" title="Regalo: <?php echo $param_regalo['nombre'] ?>">
                                    <h4 class="semi-bold points-space"><?php echo $param_regalo['nombre'] ?></h4>
                                </a>
                                <a href="regalo/<?php echo $param_regalo['id'] ?>" title="Regalo: <?php echo $param_regalo['nombre'] ?>">
                                    <img width="75%" src="web/images/regalos/<?php echo $param_regalo['imagen'] ?>">
                                </a>
                                <p class="points-space margin-top10"><?php echo substr($param_regalo['descripcion'], 0, 25); ?>...</p>
                                <hr style="margin-top:0px; margin-bottom:0px;">
                                <h4 style="text-align:center;"> <?php echo number_format($param_regalo['precio'], 0, "", "."); ?> bp </h4>
                                <hr style="margin-top:0px; margin-bottom:10px;">
                                <a data-toggle="modal" data-target="#modalSolicitarRegalo<?php echo $param_regalo['id'] ?>" class="btn btn-lg btn-block"><i class="fa fa-gift"></i> <?php echo LABEL_REGALOSSOLICITAR ?></a>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- Modal -->
                <?php if ($obj_usuario->puntos >= $param_regalo['precio']) { ?>
                    <div class="modal fade" id="modalSolicitarRegalo<?php echo $param_regalo['id'] ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel"><?php echo LABEL_REGALOSSOLICITARTEXTO1 ?> <?php echo $param_regalo['nombre'] ?></h4>
                                </div>
                                <div class="modal-body">
                                    <p style="font-size:14px; line-height:17px; margin-top:5px;"><?php echo LABEL_REGALOSSOLICITARTITULO ?><b><?php echo $param_regalo['nombre'] ?></b><?php echo LABEL_REGALOSSOLICITARTEXTO2 ?></p>
                                    <form name="solicitarRegalo" id="solicitarRegalo" method="post" action="solicitar_regalo">
                                        <input type="hidden" name="regalo" value="<?php echo $param_regalo['id'] ?>">
                                        <input class="btn btn-block btn-large btn-success" type="submit" value="Solicitar Regalo"/>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php } else { ?>
                    <div class="modal fade" id="modalSolicitarRegalo<?php echo $param_regalo['id'] ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel"><?php echo LABEL_REGALOSINSUFICIENTETITULO ?> <?php echo $param_regalo['nombre'] ?></h4>
                                </div>
                                <div class="modal-body">
                                    <p style="font-size:14px; line-height:17px; margin-top:5px;"><?php echo LABEL_REGALOSINSUFICIENTETEXTO ?></p>
                                    <p style="margin-top:10px;"><a href="#betpoints" class="btn btn-block btn-large btn-success"><?php echo LABEL_REGALOSINSUFICIENTECONSIGUE ?></a></p> 
                                </div>
                            </div>
                        </div>
                    </div>
                <?php } ?>
            <?php } ?>
        </div>
    </div>
</div>

<?php
$contenido = ob_get_clean();
include 'app/templates/plantilla_privada.php';
?>